<template>
  <div>
    <!--本体列表，数据 -->
    <div class="table-body">
      <div class="table-body-box">
        <el-table
            ref="multipleTable"
            :data="arryList"
            :stripe="tableStyle.tableStripe"
            :border="tableStyle.tableBorder"
            tooltip-effect="dark"
            header-cell-class-name="table-text-c"
            style="width: 100%">
          <el-table-column
              prop="id"
              label="ID"
              align="center"
              width="90"
              :key="1">
          </el-table-column>
          <el-table-column
              prop="name"
              label="请批人"
              :show-overflow-tooltip="true"
              align="center"
              :key="2">
            <template slot-scope="scope">
              {{ scope.row.user ? scope.row.user.realname : '' }}
            </template>
          </el-table-column>
          <el-table-column
              prop="create_time"
              label="请批时间"
              align="center"
              width="110"
              :key="3">
          </el-table-column>
          <el-table-column
              label="文宣用途"
              align="center"
              prop="purpose"
              :show-overflow-tooltip="true"
              :key="4">
          </el-table-column>
          <el-table-column
              prop="cycle"
              label="文宣周期"
              align="center"
              width="110"
              :key="5">
          </el-table-column>
          <el-table-column
              label="文宣用途说明"
              prop="content"
              align="center"
              :show-overflow-tooltip="true"
              width="150"
              :key="8">
          </el-table-column>
          <el-table-column
              label="集体决策"
              align="center"
              width="90"
              :key="10">
            <template slot-scope="scope">
              <el-popover
                  placement="left-start"
                  title="会议人员"
                  width="250"
                  v-if="scope.row.is_meeting==1"
                  trigger="hover">
                <div class="tableline">
                  <div class="list" v-for="item in scope.row.sign">
                    <p>{{ item.user.realname }}：
                      <i :style="{color: item.status==1?'green':'red'}">{{ signState[item.status] }}</i></p>
                  </div>
                </div>
                <span slot="reference" class="tablelineBtn">
                    查看
                  </span>
              </el-popover>
              <span v-else>无会议</span>
            </template>
          </el-table-column>
          <el-table-column
              label="园长审批"
              align="center"
              width="90"
              :key="11">
            <template slot-scope="scope">
              <span v-if="scope.row.status!==3 && scope.row.status!==4" style="color: red">待审批</span>
              <span v-if="scope.row.status==3" style="color: green">园长通过</span>
              <span v-if="scope.row.status==4" style="color: red">园长驳回</span>
            </template>
          </el-table-column>
          <el-table-column
              prop="status"
              label="申请部门"
              align="center"
              width="80"
              :key="12">
            <template slot-scope="scope">
              {{ scope.row.department ? scope.row.department.name : '' }}
            </template>
          </el-table-column>
          <el-table-column
              prop="status"
              label="操作"
              align="center"
              width="150"
              fixed="right"
              :key="13">
            <template slot-scope="scope">
              <el-button size="mini" @click="godeDetail(scope.row)">
                详情
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
import {pagination, tableoption} from '@/utils/util.js'
import {approveIndex} from '@/api/admin/approveApply'
import {departmentIndex} from '@/api/admin/system'
import {mapGetters} from "vuex";

export default {
  props:['arryList'],
  components: {},
  data() {
    return {
      handleSelection: [],
      // 设置table样式
      tableStyle: tableoption,
      signState: {
        0: '待确认',
        1: '已通过',
        2: '已驳回',
      }
    }
  },
  computed: {
    ...mapGetters(['userInfo']),
  },
  watch: {
  },
  created() {
  },
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    handleClick(option) {
      if (Number(option.name) !== Number(this.searchData.type)) {
        this.searchData.type = option.name
        this.InitFn()
      }
    },
    // 分页
    handleSizeChange(val) {
      this.page.pageindex = val
      this.InitFn()
    },
    getJson(option) {
      return JSON.parse(JSON.stringify(option))
    },
    godeDetail(option) {
      this.$emit('godeDetail', this.getJson(option))
    }
  },
  mounted() {
  },
  // 缓存机制 end
}
</script>


<style scoped>

.wx-user-box-line img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 5px;
}

.wx-user-box-line {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-wx {
  cursor: pointer;
  padding: 5px;
}

.btn-wx:hover {
  color: #1b8de5;
  text-decoration: underline;
}

.delet-wx {
  color: red;
  cursor: pointer;
}

.delet-wx:hover {
  text-decoration: underline;
}

.tab-body {
  display: flex;
  align-items: center;
}

.tab-box {
  flex: 1;
}

.tab-box-list {
  display: flex;
  align-items: center;
}

.examinBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: red;
}

.examinBtn i {
  font-style: normal;
  color: #1b8de5;
  cursor: pointer;
  font-size: 12px;
}

.tableline .list {
  font-size: 12px;
}

.tableline .list i {
  font-style: normal;
}

.url-box-line {
  display: flex;
  align-items: center;
  color: #3e89ff;
}

.url-box-line:hover {
  text-decoration: underline;
}

.url-box-line .url-box-line-a {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.examine-list {
  display: flex;
  padding: 10px 0;
}

.examine-list-title {
  width: 85px;
}

.examine-list-user {
  flex: 1;
}
</style>
